import React, { useState } from 'react';
import { ConfigProvider, Tabs } from 'antd';
import type { TableListItem } from './data';
import AutomatedMan from './automatedMan';
import './index.less';

const AutomatedTest: React.FC<TableListItem> = () => {
  const [key, setKey] = useState('0');
  const onChange = (key: string) => {
    setKey(key);
  };
  const items = [
    {
      label: `测试环境`,
      key: '0',
      children: <AutomatedMan value={key} />,
    },
    {
      label: `生产环境`,
      key: '1',
      children: <AutomatedMan value={key} />,
    },
  ];
  return (
    <ConfigProvider autoInsertSpaceInButton={false}>
      <div className="wrapper">
        <Tabs defaultActiveKey="0" items={items} onChange={onChange} />
      </div>
    </ConfigProvider>
  );
};

export default AutomatedTest;
